{{!

  Copyright (c) Facebook, Inc. and its affiliates.

  Licensed under the Apache License, Version 2.0 (the "License");
  you may not use this file except in compliance with the License.
  You may obtain a copy of the License at

      http://www.apache.org/licenses/LICENSE-2.0

  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License.

}}{{!

Builder class for every struct in the module.

}}
{{> common/AutoGeneratedPy}}
from cpython cimport bool as pbool, int as pint, float as pfloat

cimport folly.iobuf as __iobuf

cimport thrift.py3.builder

{{#program:includeNamespaces}}
{{#hasTypes?}}
cimport {{#includeNamespace}}{{value}}.{{/includeNamespace}}types as _{{#includeNamespace}}{{value}}_{{/includeNamespace}}types
cimport {{#includeNamespace}}{{value}}.{{/includeNamespace}}builders as _{{#includeNamespace}}{{value}}_{{/includeNamespace}}builders
{{/hasTypes?}}
{{/program:includeNamespaces}}

cimport {{#program:py3Namespaces}}{{value}}.{{/program:py3Namespaces}}{{program:name}}.types as _{{#program:py3Namespaces}}{{value}}_{{/program:py3Namespaces}}{{program:name}}_types

{{#program:structs}}
cdef class {{struct:name}}_Builder(thrift.py3.builder.StructBuilder):
    {{^struct:fields?}}
    pass
    {{/struct:fields?}}
    {{#struct:fields}}
    cdef public {{#field:type}}{{!
        }}{{#type:list?}}list {{/type:list?}}{{!
        }}{{#type:map?}}dict {{/type:map?}}{{!
        }}{{#type:set?}}set {{/type:set?}}{{!
        }}{{#type:integer?}}pint {{/type:integer?}}{{!
        }}{{#type:floating_point?}}pfloat {{/type:floating_point?}}{{!
        }}{{#type:struct?}}object {{/type:struct?}}{{!
        }}{{#type:cythonTypeNoneable?}}{{^type:struct?}}{{!
        }}{{> types/CythonPythonType}} {{!
        }}{{/type:struct?}}{{/type:cythonTypeNoneable?}}{{!
        }}{{/field:type}}{{field:py_name}}
    {{/struct:fields}}


{{/program:structs}}
